<template>
	<view class="article-detail">
		<common-navbar title="案件详情"></common-navbar>
		<view class="article-detail-main">
			<view class="article-title">
				{{caseDetail.title}}
			</view>
			<view class="article-info-wrapper">
				<view class="article-publisher">
					{{caseDetail.court}}
				</view>
				<view class="article-date">
					{{caseDetail.reference_number}}
				</view>
			</view>
			<view class="article-content">
				<u-parse :html="caseDetail.content"  :show-with-animation="true" :lazy-load="true"></u-parse>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		async onLoad(options) {
			this.caseId = options.id;
			await this.$loginStatus;
			this.getArticleDetail();
		},
		data() {
			return {
				caseId: '',
				caseDetail: {
					title:'',
					court:'',
					content:'',
					reference_number:'',
				},
			}
		},
		methods: {
			async getArticleDetail() {
				const {
					data
				} = await this.$u.post(this.$restUrl.getCaseDetailByid, {
					case_id: this.caseId,
				})
				this.caseDetail = data;
				console.log('文章详情数据>>>>>>>>>>>>>>>>', this.caseDetail);
			}
		}
	}
</script>

<style scoped lang="scss">
	@import "./caseDetail.scss"
</style>
